package com.rose.datax;

import com.alibaba.fastjson.JSONObject;

import jodd.http.HttpRequest;
import jodd.http.HttpResponse;

public class EngineTest {

	public static void main(String[] args) throws Throwable {
		HttpResponse response = HttpRequest.post("http://127.0.0.1:8080/xxl-job-admin/jobinfo/add").charset("UTF-8")
				.form("jobGroup", "1").form("jobDesc", "数据同步").form("jobCron", "0 0/1 * * * ?").form("author", "zoro")
				.form("executorRouteStrategy", "FIRST").formOverwrite("executorHandler", "demoJobHandler")
				.form("executorBlockStrategy", "DISCARD_LATER").form("executorParam", "11111111")
				.form("glueType", "BEAN").send();

		JSONObject jsonObject = JSONObject.parseObject(response.body());
		HttpRequest.post("http://127.0.0.1:8080/xxl-job-admin/jobinfo/start").form("id", jsonObject.get("content"))
				.send();
		System.out.println("1111");
	}
}